package org.hongbo.springbootebsapi.bean;


import org.hongbo.springbootebsapi.aspect.RestControllerAspect;
import org.hongbo.springbootebsapi.handler.GlobalExceptionHandler;
import org.hongbo.springbootebsapi.handler.ResponseResultHandler;
import org.hongbo.springbootebsapi.interceptor.AllowRespInfoNullInterceptor;
import org.hongbo.springbootebsapi.interceptor.ResponseResultInterceptor;
import org.hongbo.springbootebsapi.interceptor.TokenValidInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class BeanConfig {

    @Bean
    public GlobalExceptionHandler globalExceptionHandler() {
        return new GlobalExceptionHandler();
    }

    @Bean
    public ResponseResultHandler responseResultHandler() {
        return new ResponseResultHandler();
    }

    @Bean
    public ResponseResultInterceptor responseResultInterceptor(){
        return  new ResponseResultInterceptor();
    }

    @Bean
    public RestControllerAspect restControllerAspect() {
        return new RestControllerAspect();
    }

    @Bean
    public TokenValidInterceptor tokenValidInterceptor(){
        return new TokenValidInterceptor();
    }

    @Bean
    public AllowRespInfoNullInterceptor allowRespInfoNullInterceptor(){
        return new AllowRespInfoNullInterceptor();
    }



}
